package com.fqgj.sentry.policy.engine.domain.enums;

public enum PolicyComposeEnum {

    /**
     * 规则的组合方式: 首次匹配（顺序执行）| 最坏匹配（并行执行）
     */

    FIRST, WORST;


    public static PolicyComposeEnum transformByType(Integer type) {
        for (PolicyComposeEnum policyComposeEnum : PolicyComposeEnum.values()) {
            if (policyComposeEnum.ordinal() + 1 == type) {
                return policyComposeEnum;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        PolicyComposeEnum policyComposeEnum = transformByType(2);
        System.out.println(policyComposeEnum);
    }

}
